home *** CD-ROM | disk | FTP | other *** search
-
- > Pity Scotland didn't do so well. :I
-
- > Yep, and today is all black when france losed in penalties and
- > england too:-(((((((((
-
- :(
-
-
- > A little bit faster is always beeter than a little bit slower:-)
- > Anyway a straightforward question: On an previous discussion you said
- > that the monsters etc. was to be handled as transparent walls? so
- > when the monsters are there they will surely slow down the framerate,
- > because it's the same effect as a complex room??
-
- It doesn't really work like that. The transparent walls take lots of time
- because they are floor-to-ceiling, wall-to-wall, which gives them a very
- large surface area. It's the surface area that 'hurts'. The other factor
- is that the engine doesn't stop drawing when it hits a transparent wall.
- It has to keep going until it finds a solid one - so a transparent wall
- automatically means lots of additional drawing beyond the wall itself,
- as if you can see directly into yet more rooms. This just adds to the
- problem.
-
- Sprites are much smaller, they don't increase the complexity of the room
- and they are not perspected. This all helps a great deal. BM's wall calculation
- is optimised for non-perspected (face-on) walls so sprites will draw a little
- faster anyway.
-
- Even if there is a speed problem, there is one final (very difficult)
- upgrade which can be made to speed up sprites & transparencies - but
- there is a cost. The compexity of the sprite's mask will determine how
- fast it will draw. A squarish, or roundish sprite with only a few 'holes'
- will be quick, while a 2x2 pixel checkerboard of pixels and holes will
- be the worst case possible. You can probably work out the rest from there.
-
- I'd like to avoid having to do this if possible, because it's quite involved
- and I have less and less free time these days. :)
-
- > Great! You said before that you thought that Doom cheated alot in the
- > perspective calculations and that if you could found out the cheat
- > you could speed up things even more, have you found that cheat??
-
- In Doom, every pixel-wide 'column' in each wall, and every pixel-high 'row'
- in each floor must be inverse-perspected to find out where in the texture
- to start fetching pixels from. This is extremely difficult, and very intensive.
-
- I am currently using a method I devised myself, but I have no idea how much
- it is like the actual Doom method - all I know is that every other method I
- used failed due to lack of precision. The most obvious methods even failed
- using a 68882 with 80-bit accuracy! I eventually managed to succeed using
- a rather odd approach & with 24-bit & 48-bit fixed point maths (which is
- MUUUUCH less accurate than a 68882!).
-
- I now have an idea about Doom's own method, and it is a real cheat. It explains
- how they manage to do it so quickly. They use a simple fudge to produce a
- 'curve' which closely matches the real 1/z perspective curve. It's not identical
- by any means, but it's close enough. The system itself is simply to use a quadrant
- of a sinewave - basically a lookup table (which is not very intensive at all) but
- unfortunately, if you fudge this bit using tables, then you must also fudge the
- other 'real' perspective in the 3D polygon engine - otherwise your walls won't
- match up with the textures supposed to be attatched to them. Do you see what I mean?
- If you hack 10% then you have to hack 100%. I don't want to do that much damage to
- Bad Mood, and the DSP does a good job already. There would probably be little
- or no saving at the end of the day, since the 68030 would need to replace the
- DSP in this case due to memory requirements for the huge lookup tables.
-
- If you want to see this sinewave trick in action, then look at the sky texture
- in quake as it reaches the horizon - you will see that it starts to 'stretch'
- as it approaches the middle - there is no real horizon. This is te point where
- the sinewave table matches the perspective curve LEAST. It just happens to
- look nice in quake's sky. :)
-
- Anyway, in a nutshell, it's not really worth trying anymore.
-
- Doug.
-
-
-